

module.exports = function ($scope,$state, $resource,$stateParams, itemparam,$http,$modalInstance) {

			$scope.user1 = itemparam;
            console.log($scope.user1);
				 $scope.updateinfor1=function(obj){
            
  
                    if(obj.place==undefined || obj.place==""){
                       alert("请填写所在区县");
                        return false;
                   }
                
                 if(obj.type==undefined || obj.type==""){
                        alert("请选择用户类别");
                        return false;
                   }
                    if(obj.responsible_person==undefined || obj.responsible_person==""){
                        alert("请填写主要负责人（法人）");
                        return false;
                   }
                    if(obj.responsible_person_phone==undefined || obj.responsible_person_phone==""){
                        alert("请填写联系电话");
                        return false;
                   }
                   if(obj.manager_person==undefined || obj.manager_person==""){
                        alert("请填写企业负责人");
                        return false;
                   }
                    if(obj.manager_person_phone==undefined || obj.manager_person_phone==""){
                        alert("请填写企业负责人电话");
                        return false;
                   }
                        
                      
                   $resource('/api/ac/ggc/equipmentUserManageService/updateEquipmentUser', {}, {})
                    .save(obj, function (res) {
                    
                        if (res.errcode !== 0) {
                          alert(res.errmsg);      
                          return;   
                        };
                         //$state.go('app.equipmentUserManage',{},{reload: true});
                         $modalInstance.dismiss('cancel');
                         alert("信息修改成功");
                     })
              
        }

      


      
}
